/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dds2.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Piter
 */
@Embeddable
public class UserPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "id")
    private int id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "Profile_id")
    private int profileid;

    public UserPK() {
    }

    public UserPK(int id, int profileid) {
        this.id = id;
        this.profileid = profileid;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getProfileid() {
        return profileid;
    }

    public void setProfileid(int profileid) {
        this.profileid = profileid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) id;
        hash += (int) profileid;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserPK)) {
            return false;
        }
        UserPK other = (UserPK) object;
        if (this.id != other.id) {
            return false;
        }
        if (this.profileid != other.profileid) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mx.its.dds2.modelo.UserPK[ id=" + id + ", profileid=" + profileid + " ]";
    }
    
}
